#include <iostream>
#include <string>
#include <cctype>
#include <sstream>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;

struct strCmp
{
    bool operator()(const pair<string, int>& p1, const pair<string, int>& p2)
    {
        return p1.second > p2.second || (p1.second == p2.second && p1.first < p2.first);
    }
};

int main()
{
    string tmp, word;
    vector<string> words;
    int count = 1;
    while (getline(cin, tmp))
    {
        istringstream iss(tmp);
        while (iss >> word)
        {
            if (count++ == 1)
                transform(word.begin(), word.end(), word.begin(), ::tolower);

            words.push_back(word);
        }
        words.back().pop_back();
    }

    map<string, int> countStr;
    for (auto& str : words)
    {
        countStr[str]++;
    }

    vector<pair<string, int>> vt(countStr.begin(), countStr.end());
    sort(vt.begin(), vt.end(), strCmp());

    for (auto& e : countStr)
    {
        cout << e.first << ":" << e.second << endl;
    }
    return 0;
}
